{include file="index/header"}
<body>
<div class="fly-panel fly-panel-user">
  <div class="tpt-admin">
    <fieldset class="layui-elem-field layui-field-title">
      <legend>添加采集器</legend>
    </fieldset>
    <form class="layui-form">
      <!-- 采集器名称 -->
      <div class="layui-form-item">
        <label class="layui-form-label">采集器名称</label>
        <div class="layui-input-block">
          <input type="text" name="name" required lay-verify="required" placeholder="必填内容" autocomplete="off" class="layui-input">
        </div>
      </div>
      <!-- 入库分类 -->
      <div class="layui-form-item" style="width: 300px;">
        <label class="layui-form-label">入库分类</label>
        <div class="layui-input-block">
          <select name="cid">
          {volist name="CategoryList" id="vo"}
            {if condition="$vo.open eq 1"}
              <option value="{$vo.id}">{$vo.name}</option>
            {/if}
          {/volist}
          </select>
        </div>
      </div>
      <!-- 采集分类 -->
      <div class="layui-form-item" style="width: 300px;">
        <label class="layui-form-label">采集分类</label>
        <div class="layui-input-block">
          <select name="dtkcid">
            <option value="1">女装</option>
            <option value="9">男装</option>
            <option value="10">内衣</option>
            <option value="2">母婴</option>
            <option value="3">化妆品</option>
            <option value="4">居家</option>
            <option value="5">鞋包配饰</option>
            <option value="6">美食</option>
            <option value="7">文体车品</option>
            <option value="8">数码家电</option>
          </select> 
        </div>
      </div>
      <!-- 所属类型 -->
      <div class="layui-form-item">
        <label class="layui-form-label">所属类型</label>
        <div class="layui-input-block">
          <input type="radio" name="type" value="1" title="优惠卷" checked="">
          <input type="radio" name="type" value="2" title="不限" disabled="">
        </div>
      </div>
      <div class="layui-form-item">
        <div class="layui-input-block">
    	  <button class="layui-btn" lay-submit="" lay-filter="robotdtk_add">立即提交</button>
          <button class="layui-btn layui-btn-primary" onclick="history.go(-1)">返回</button>
        </div>
      </div>
    </form>
  </div>
</div>
{include file="index_footer"}
<script type="text/javascript">
layui.use(['form'],function(){
  var form = layui.form()
  ,jq = layui.jquery;
  
  form.on('submit(robotdtk_add)', function(data){
    loading = layer.load(2, {
      shade: [0.2,'#000']
    });
    var param = data.field;
    jq.post('{:url("robotdtk/add")}',param,function(data){
      if(data.code == 200){
        layer.close(loading);
        layer.msg(data.msg, {icon: 1, time: 1000}, function(){
          location.href = '{:url("robotdtk/index")}';
        });
      }else{
        layer.close(loading);
        layer.msg(data.msg, {icon: 2, anim: 6, time: 1000});
      }
    });
    return false;
  });
})
</script>
</body>
</html>